import 'package:flutter_screenutil/screenutil.dart';
import 'package:flutter/material.dart';
import 'package:heyangkuaidai/DemonStrateModule/Components/TwoLabelItem.dart';
import 'package:heyangkuaidai/DemonStrateModule/Components/SmsCodeItem.dart';
import 'package:heyangkuaidai/DemonStrateModule/Components/LeftLabelInputItem.dart';
import 'package:heyangkuaidai/DemonStrateModule/Components/NavigationBar.dart';
import 'package:heyangkuaidai/DemonStrateModule/RepaySuccessPage.dart';
class LoanRepayConfirmPage extends StatefulWidget {
  String money;
  LoanRepayConfirmPage({this.money});
  @override
  _LoanRepayConfirmPageState createState() => _LoanRepayConfirmPageState();
}

class _LoanRepayConfirmPageState extends State<LoanRepayConfirmPage> {
  String password;
  @override
  Widget build(BuildContext context) {
    ScreenUtil.init(context, width: 375, height: 667, allowFontScaling: true);
    String money =widget.money;
    return Scaffold(
      resizeToAvoidBottomInset: false,
      body: Column(
        children: [
          SizedBox(height: MediaQuery.of(context).padding.top,),
          NavigationBar(false,title: "借款归还",),
          Container(
              width: ScreenUtil.screenWidth,
              height: ScreenUtil().setWidth(173),
              child: ListView(
                padding: EdgeInsets.only(top: 0),
                children: [
                  TwoLabelItem(title:"还款金额",hitText: "$money元",),
                  SizedBox(height: ScreenUtil().setWidth(10),),
                  smsCodeItem(),
                  LeftLabelInputItem(title: "交易密码",hitText: "请输入交易密码",finishCallback: (text){
                    password =text;
                  },obscureText: true,),
                ],
              )
          ) ,
          Container(
            width: ScreenUtil().setWidth(341),
            // height: ScreenUtil().setWidth(21),
            child:Center(
              child: Text("短信验证码已发送至136****9654，请注意查收。",style: TextStyle(fontSize: ScreenUtil().setSp(15),color: Color(0xff666666)),textAlign: TextAlign.left,),
             ),
          ),
          SizedBox(height: ScreenUtil().setWidth(23),),
          InkWell(
            onTap: (){
              if(password.isEmpty){
                return;
              }
               Navigator.push(
                  context,
                  new MaterialPageRoute(
                    builder: (context) => new RepaySuccessPage(money: money,),
                  ),
                );

            },
            child: Container(
                decoration: BoxDecoration(
                  borderRadius: BorderRadius.circular(4),
                  color:Color(0xff41A5EE),
                ),
                width: ScreenUtil().setWidth(347),
                height: ScreenUtil().setWidth(44),
                child:Center(
                  child: Text("确定",style: TextStyle(fontSize: ScreenUtil().setSp(17),color: Colors.white),textAlign: TextAlign.center,),
                )
            ) ,
          )
        ],
      ),
    );
  }
}
